package com.zhiche.lisa.lspm.dao.mapper.driver;


import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.zhiche.lisa.lspm.dao.model.driver.DriverCheckin;
import com.zhiche.lisa.lspm.dao.model.driver.bo.DriverCheckinBO;
import com.zhiche.lisa.lspm.dao.model.driver.bo.DriverCheckinLineBO;
import com.zhiche.lisa.lspm.dto.DriverCheckinDTO;
import com.zhiche.lisa.lspm.vo.driver.DriverCheckinLineVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 司机报班记录 Mapper 接口
 * </p>
 *
 * @author qichao
 * @since 2018-05-23
 */
public interface DriverCheckinMapper extends BaseMapper<DriverCheckin> {

    /**
     * 司机报班记录列表
     */
    List<DriverCheckinLineVO> driverCheckinLine(Page<DriverCheckinLineBO> page,
                                                @Param("ew") Wrapper<DriverCheckinLineBO> ew);

    /**
     * 司机取消报表记录
     */
    List<DriverCheckinLineVO> driverCancelCheckinLine(Page<DriverCheckinLineBO> page,
                                                      @Param("ew") Wrapper<DriverCheckinLineBO> ew);

    /**
     * app获取司机报班列表
     */
    List<DriverCheckinBO> selectCheckinListNoTenant(Page<DriverCheckinBO> page,
                                                    @Param("ew") Wrapper<DriverCheckinBO> ew);

    /**
     * 获取当天报班信息
     */
    List<DriverCheckin> selectByNowDayNoTenant(@Param("driverId") Long driverId);

    /**
     * 获取三天前的报班信息
     */
    List<DriverCheckin> getDriverCheckinThreeDaysAgo(@Param("status") String status);


    /**
     * 得到小于某个时间的报班信息
     */
    List<DriverCheckin> getDriverCheckinNoTenant(@Param("gmtCheckin") String gmtCheckin, @Param("status") String status);

    DriverCheckinDTO getDriverCheckinById(@Param("checkinId") Long checkinId);

    DriverCheckin getDriverCheckinByIdNotenant(@Param("checkinId") Long checkinId);

    /**
     * 查询报班列表 -- pc
     */
    List<DriverCheckinDTO> queryCheckinPage(@Param("page") Page<DriverCheckinDTO> page,
                                            @Param("ew") EntityWrapper<DriverCheckinDTO> ew);

    DriverCheckin selectByIdNoTenant(@Param("checkinId") Long checkinId);

    DriverCheckinDTO getDriverCheckinByIdNoTenant(@Param("checkinId")Long id);

    /**
     * 获取司机报班传入OTM日志列表
     * */
    List<DriverCheckinLineVO> getdriverCheckinOtmLog(Page<DriverCheckinLineBO> page,
                                                     @Param("ew") Wrapper<DriverCheckinLineBO> ew);

    List<DriverCheckin> selectCheckinByLspId(@Param("lspId")String lspId);

    List<DriverCheckin> selectCheckinByFleetId(@Param("fleetId")String fleetId);
}
